

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

// MARK:方向
typedef NS_ENUM(NSUInteger, FormDirection) {
    FormDirectionHorizontal = 0,    //!< 水平(默认)
    FormDirectionVertical = 1,      //!< 垂直
};

// MARK:对齐
typedef NS_ENUM(NSUInteger, FormAlignment) {
    FormAlignmentLeft = 0,          //!< 左对齐(默认)
    FormAlignmentTop = 1,           //!< 上对齐
    FormAlignmentRight = 2,         //!< 右对齐
    FormAlignmentBottom = 3,        //!< 下对齐
    FormAlignmentCenter = 4,        //!< 居中对齐
    FormAlignmentJustified = 5,     //!< 两端对齐
};

// MARK:约束
@interface FormConstraint : NSObject
/** 外间距 */
@property (nonatomic) UIEdgeInsets margin;
/** 内间距 */
@property (nonatomic) UIEdgeInsets padding;
/** 相邻间距 */
@property (nonatomic) CGFloat space;
/** 方向 */
@property (nonatomic) FormDirection direction;
/** 对齐 */
@property (nonatomic) FormAlignment alignment;
@end

@interface FormApiModel : NSObject
/** 提交接口字段名 */
@property (nonatomic, copy) NSString *key;

@end

#pragma mark - 模型
@interface SuperFormModel : NSObject
/** 组件ID */
@property (nonatomic, copy) NSString *ID;
/** 组件名 */
@property (nonatomic, copy) NSString *name;
/** 组件图标 */
@property (nonatomic, copy) NSURL *iconURL;
/** 组件约束 */
@property (nonatomic) FormConstraint *constraint;
/** 标题约束 */
@property (nonatomic) FormConstraint *titleConstraint;
/** 内容约束 */
@property (nonatomic) FormConstraint *contentConstraint;
@end

NS_ASSUME_NONNULL_END
